<!doctype html>
<html>

<script type="text/javascript" src="ParsePDB.js"></script>
    
<script>
function handle_files(files) {
    for (i = 0; i < files.length; i++) {
        file = files[i]
        console.log(file)
        var reader = new FileReader()
        ret = []
        reader.onload = function(e) { // File has been read
            var pdbtext = e.target.result;
            parsePDB(pdbtext);
        }
        reader.onerror = function(stuff) {
            console.log("error", stuff)
            console.log (stuff.getMessage())
        }
        reader.readAsText(file) //readAsdataURL
    }
}
</script>
<body>

<input type="file" multiple onchange="handle_files(this.files)">
</body>
</html>